/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.sistemas.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.general.adapters.EmpleadoAdapter;
import org.cip.esymons.general.bc.EmpleadoFacadeLocal;

/**
 *
 * @author WILLIAM
 */
public class empleadoDelegate {

    public EmpleadoFacadeLocal local;
    
    public empleadoDelegate() {
        
        local = lookupEmpleadoFacadeLocal();
    }
    
     public List<EmpleadoAdapter> listarDestinatarioDocumento(String cadena) {
        return local.listarDestinatarioDocumento(cadena);
    }

    private EmpleadoFacadeLocal lookupEmpleadoFacadeLocal() {
        try {
            Context c = new InitialContext();
            return (EmpleadoFacadeLocal) c.lookup("java:comp/env/EmpleadoFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
